<?php
class ps_MetaBase_Driver_BigFilesystem extends ps_Metabase_Driver_Filesystem 
	implements ps_MetaBase_iDriver {
  protected function initCache() {
    parent::initCache();
    for ( $i = 0; $i <= 255; $i++ ) {
        $hexdir = str_pad( dechex( $i ) , 2, '0', STR_PAD_LEFT );
    	if ( !file_exists( $this->getPath() . '/' . $hexdir ) ) {
             mkdir( $this->getPath(). '/' . $hexdir , 0700 );
    	}
    }
  }

  protected function getFilePath( $key ) {
        $filename = $this->getFilename( $key );
        $presplit = substr( $filename, 0, 2);        // Big Filesystem
        return $this->getPath() . '/' . $presplit  . '/' . $filename;
  }
}
?>
